import 'swiper/css'
import './Swiper.scss'

import 'swiper/css/effect-fade'
import 'swiper/css/navigation';
import 'swiper/css/pagination';
import 'swiper/css/scrollbar';

import { Swiper, SwiperSlide } from 'swiper/react'
import { Autoplay, EffectFade, Navigation, Pagination, Scrollbar, A11y } from 'swiper/modules'

// 预览附件轮播
export const FilePreviewSwiper = ({ data }) => {
    return (
        <div className='FilePreviewSwiper'>
            <Swiper
                modules={[Navigation, Pagination, Scrollbar, A11y]}
                loop={true}
                speed={500}
                navigation
                pagination={{ clickable: true }}
                scrollbar={{ draggable: true }}
            >
                {data.map(({ uuid, url }) =>
                    <SwiperSlide key={uuid}>
                        <img src={url} alt="" />
                    </SwiperSlide>
                )}
            </Swiper>
        </div>
    )
}